var svg, r = 50, dir = -1, circle;

$(function()
{
  $('#svg').svg();
  
  svg = $('#svg').svg('get');
  circle = svg.circle(null, 130, 75, r, {fill: 'none', stroke: 'red', 'stroke-width': 3});
  var g = svg.group(null, {stroke: 'black', 'stroke-width': 2});
  svg.line(g, 70, 75, 190, 75);
  svg.line(g, 130, 15, 130, 135);
  
  resizeCircles();
});

function resizeCircles()
{
  if (dir === -1 && r < 1) {
    dir = 1;
  } else if (dir === 1 && r > 50) {
    dir = -1;
  }
  
  r += dir;
  
  circle.setAttribute('r', r);
  
  setTimeout(resizeCircles, 1);
}
